package com.dong.sqltoy.tenant;

import com.alibaba.ttl.TransmittableThreadLocal;

public class TenantContextHolder {
    
    private static final TransmittableThreadLocal<String> TENANT_CONTEXT = new TransmittableThreadLocal<>();

    public static void setCurrentTenantId(String tenantId) {
        TENANT_CONTEXT.set(tenantId);
    }

    public static String getCurrentTenantId() {
        return TENANT_CONTEXT.get();
    }

    public static void clear() {
        TENANT_CONTEXT.remove();
    }
}